/**
 * 
 */
package com.thor.palmmall.rest.position.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.position.APositionParam;
import com.thor.palmmall.spi.position.SPositionParam;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SPositionParamConverter implements Converter<APositionParam, SPositionParam> {

  public static SPositionParamConverter getInstance() {
    if (instance == null)
      instance = new SPositionParamConverter();
    return instance;
  }

  private static SPositionParamConverter instance;

  private SPositionParamConverter() {
  }

  @Override
  public SPositionParam convert(APositionParam source) {
    if (source == null) {
      return null;
    }
    SPositionParam target = new SPositionParam();
    target.setDate(source.getDate());
    target.setPositionId(source.getPositionId());
    target.setStoreCode(source.getStoreCode());
    return target;
  }

}
